home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
hardware
/
videot.arc
/
VIDEO_ID.DOC
next >
Wrap
Text File
|
1989-03-02
|
5KB
|
128 lines
VIDEO_ID Detection Program (c) 1989, Ed Tobias/Clyde McKenney
Often it is desirable to execute a particular version of a program
based on the computer's hardware setup. This is particularly true on
a network, where many different computers, with different hardware,
share the same programs. For example, different versions of Windows
are required which depend on a combination of the computer's video
adapter, monitor, video ram, and whether or not a mouse is present.
Lotus requires different .SET files for each combination of hardware.
Other programs such as Microsoft Word may require certain DOS
environment variables to be set to help them determine how to
operate.
These parameters can be set for each workstation on the network in a
variety of ways. Some just use DOS SET in the user's login script -
but that limits the user to one workstation type. Some menu systems
and remote-assist type programs store workstation-specific hardware
data in a .DAT or .WKS file which is examined on startup. In this
case, the network supervisor must be careful to record each hardware
change in a file somewhere (and maybe in multiple files), which in
turn requires that the supervisor be aware of these hardware changes.
VIDEO_ID provides a quick way to determine, ON THE FLY, what hardware is
present WITHIN a batch file, and branch to specific instructions
(such as changing to a specific directory), or SET a DOS environment
variable to a particular string accordingly. It does this by setting
the DOS ERRORLEVEL to a particular number, based on the parameter
passed to VIDEO_ID and the hardware that VIDEO_ID detects. The DOS
ERRORLEVEL is a system setting which can be determined in a batch
file through use of the IF ERRORLEVEL == statement.
The following parameters are available for testing:
[A]dapter - If invoked with an "a" or "A", VIDEO_ID sets the DOS ERRORLEVEL
as follows to indicate the type of video adapter present:
1 - MDPA - Monochrone Display & Printer Adapter
2 - CGA - Color Graphics Adapter
3 - EGA - Enhanced Graphics Adapter
4 - VGA - Video Graphics Array
5 - MCGA - Multi Color Graphics Array
6 - HGC - Hercules Graphics Card
99 - could not determine
[D]isplay - If invoked with a "d" or "D", VIDEO_ID sets the DOS ERRORLEVEL
as follows to indicate the type of video display monitor present:
1 - MONO - monochrone display monitor
2 - COLOR - color (or enhanced emulating color) display
3 - ENHCOLOR - enhanced color display
4 - ANALOGMONO - Analog monochrome only display
5 - ANALOGCOLOR- Analog color only display
6 - ANALOG - Analog monochrome and color display
99 - could not determine
[V]ideo RAM - If invoked with a "v" or "V", VIDEO_ID sets the DOS ERRORLEVEL
as follows to indicate the amount of video RAM memory present:
1 - 16K
2 - 32K
3 - 64K
4 - 128K
5 - 256K
6 - 512K
99 - could not determine
[S]ystem RAM - If invoked with an "s" or "S", VIDEO_ID sets the DOS
ERRORLEVEL as follows to indicate the amount of System Base RAM memory
present:
1 - 256K
2 - 512K
3 - 640K
99 - could not determine
If you know a particular program will bomb if there is not enough
memory present, this may help to prevent crashes. Note that the
amount does NOT tell you how much memory is FREE, just how much is
present.
[C]omspec Drive - If invoked with a "c" or "C", VIDEO_ID sets the DOS
ERRORLEVEL as follows to indicate the current drive COMSPEC is mapped to:
1 - A
2 - B
3 - C
4 - D
5 - E
6 - F
7....26 = g....z
99 - comspec drive could not be determined
This may be useful in login scripts to decide whether to reset the
comspec to a network drive, if the computer was booted from a
floppy, etc.
[M]ouse - If invoked with an "m" or "M", VIDEO_ID sets the DOS ERRORLEVEL
as follows to indicate the presence or absence of a mouse:
1 - mouse present
2 - mouse absent
Since there is only 1 ERRORLEVEL setting at any given time, VIDEO_ID must be
called separately for each type of information desired. Repeated
calls may be required sometimes, to get all the information needed.
However, judicious batch file writing will help. Rather than having
many branches with similar instructions, use an environment variable
to concatenate the results. See the following:
VIDEO_ID A
IF ERRORLEVEL 3 SET VIDEOTYPE=EGA
VIDEO_ID V
IF ERRORLEVEL 1 SET VIDEOTYPE=%VIDEOTYPE%256
CD \WINDOWS\%VIDEOTYPE%
WIN
SET VIDEOTYPE=
Please note that when testing for the DOS ERRORLEVEL in a batch file,
values greater than or equal to that specified will all evaluate as
true. In other words, if the DOS ERRORLEVEL is set to 4, then the batch
file statement "IF ERRORLEVEL == 1" evaluates as true.
Comments and suggestions regarding this program are welcome. Please
forward comments via Easyplex to CompuServe ID 75410,2026.